//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================

namespace App.Domain.Handlers
{
    using System;
    using App.Data;
    using App.Domain.Contracts;
    using App.Model;
    using System.Linq;
    using System.Collections;
    using System.Collections.Generic;

    public class GetPictureByCompanyId
    {
        private readonly IPictureRepository _pictureRepository;

        public GetPictureByCompanyId(IPictureRepository pictureRepository)
        {
            _pictureRepository = pictureRepository;
        }

        public IEnumerable<Picture> Execute(Guid companyId)
        {
            try
            {
                return _pictureRepository.GetAll().Where(i => i.CompanyId == companyId);
            }
            catch (InvalidOperationException ex)
            {
                throw new BusinessServicesException("UnableToRetrieveReminderExceptionMessage", ex);
            }
        }
    }
}
